import os
from dotenv import load_dotenv
from app import create_app
from app.extensions import db
from app.models import User, Profile, Categorys

doenv_path = os.path.join(os.path.dirname(__file__), '.env')

if os.path.exists(doenv_path):
    load_dotenv(doenv_path)

app = create_app('production')


@app.shell_context_processor
def make_shell_context():
    return dict(db=db, User=User, Profile=Profile, Categorys=Categorys)
